from django.db import models

# Create your models here.


class User(models.Model):
    '''账号表'''

    gender = (
        ('male', '男'),
        ('female', '女'),
    )

    name = models.CharField(max_length=128, unique=True)
    password = models.CharField(max_length=256)
    sex = models.CharField(max_length=32, choices=gender, default='男')
    c_time = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.name

    class Meta:
        ordering = ['c_time']
        verbose_name = '账号'
        verbose_name_plural = '账号'

# 订单列表
class OrderList(models.Model):
    name = models.CharField(max_length=128, verbose_name="客户姓名")
    phone = models.CharField(max_length=11, verbose_name="手机号")
    c_time = models.DateTimeField(auto_now_add=True, verbose_name="录入时间")

    def __str__(self):
        return self.name

    class Meta:
        ordering = ['c_time']
        verbose_name = "客户订单列表"
        verbose_name_plural = "客户订单列表"
